package com.kestrel.space.common.utils;


/**
 * @author yebolin
 * @date 2024/8/21
 */
public class LargePage {
    public static final String ORDER_DESC = "desc";
    public static final String ORDER_ASC = "asc";
    public static final String ORDER_SPLIT = ",";
    private int page = 1;
    private int rows = 10;
    private String sort;
    private String order;
    private boolean count = true;

    public LargePage() {
    }

    public LargePage(int page, int rows) {
        this.page = page;
        this.rows = rows;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public boolean isCount() {
        return this.count;
    }

    public void setCount(boolean count) {
        this.count = count;
    }

    public int getPageNum() {
        return this.page;
    }

    public void setPageNum(int pageNum) {
        this.setPage(pageNum);
    }

    public int getPageSize() {
        return this.rows;
    }

    public void setPageSize(int pageSize) {
        this.setRows(pageSize);
    }

    public String getSort() {
        return this.sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getOrder() {
        return this.order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public int getStart() {
        return this.getPageSize() * (this.getPageNum() - 1);
    }

    public int getEnd() {
        return this.getPageSize() * this.getPageNum();
    }
}
